<?php $this->section->begin('breadcrumb')?>
<div id="global-breadcrumb">
	<ul>
		<li><a href="<?php echo $this->url->action("index", "Manager", "Navigation")?>">Menu</a></li>
		<li class="current"><?php echo $heading?></li>
	</ul>
</div>
<?php $this->section->end()?>
<?php $this->content->begin()?>
<div class="widget-shell inner-shadow">
	<div class="widget-header">
		<h2><?php echo $heading?></h2>
	</div>
	<div class="widget-body">
        <ol class='sortable'>
            <?php foreach($slides as $s): ?>
            <li id='list_<?php echo $s->id?>'>
                <div class='title'>
                    <img src="<?php echo $s->image?>" alt="<?php echo $s->title?>" style="height: 30px">
                    <span><?php echo $s->title?></span>
            	    <div class='options'>
            		    <a href='<?php echo $this->url->action('edit', array($s->id))?>' class='button ico-btn ico-text-edit tool-tip' title='<?php echo $s->title?>' rel='edit'>
            			</a>
            			<a href='<?php echo $this->url->action('delete', array($s->id))?>' class='button ico-btn ico-text-trash tool-tip' item='<?php echo $s->title?>' title='<?php echo $s->title?>'
            					data='<?php echo $s->id?>' rel='delete'>
            			</a>
                    </div>
            	</div>
            </li>
            <?php endforeach; ?>
        </ol>
        <div class="fclear"></div>
		<div class="alert alert-info alert-loading" style="margin-bottom: 0; display: none;">
			<p><span class="ico-text ico-alert-loading"></span><span>Đang cập nhật thứ tự ảnh...</span></p>
		</div>
		<div class="alert alert-error" style="margin-bottom: 0; display: none;">
			<p><span class="ico-text ico-alert-error"></span><span id="errorMessage"></span></p>
		</div>
		<div class="alert alert-success" style="margin-bottom: 0; display: none;">
			<p><span class="ico-text ico-alert-success"></span><span id="successMessage"></span></p>
		</div>
		<?php $this->form->begin('orderList')?>
		<div class="global-form-footer">
			<input class="btn-theme" id="submit" type="submit" value="Cập nhật">
			<a href="<?php echo $this->url->action("create", array($navType))?>" class="button">
				<span class="ico-text ico-text-brainstorm"></span>Thêm ảnh mới
			</a>
			<a href="<?php echo $this->url->action("index")?>" class="button">
    			<span class="ico-text ico-text-category"></span>Danh sách slide
    		</a>
		</div>
		<?php $this->form->end()?>
	</div>
</div>
<div id="dialogDelete" style="display: none"></div>
<?php $this->content->end()?>
<?php $this->section->begin("scripts")?>
<?php 
    //Load js
    $this->html->loadJs(array(
    						'Content/XAdmin/js/jquery.ui.nestedSortable.js',
                            'Areas/Slide/Assets/js/index_controlpanel.js'
                        ));
?>
<?php $this->section->end()?>
<?php $this->section->begin("stylesheets")?>
<?php 
    //Load css
    $this->html->loadCss('Areas/Slide/Assets/css/index_controlpanel.css');
?>
<?php $this->section->end()?>